<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Doctor Roster Management System</title>
	<style type="text/css">
.datatable td {
	vertical-align:top;
}
</style>
</h:head>
<h:body>

	<p:layout fullPage="true">

		<p:layoutUnit position="north" resizable="true" size="80"
			closable="true" collapsible="true">
			<h:form>
				<h:outputText
					value="Roster Management System for Doctor and Patient"
					style="width:100%; height:50%; text-align:center; font-size:150% !important;position:absolute; margin-left:0; margin-right:0; margin-top:0;margin-bottom:0" />
				<div style="float: right">
					<h:outputText value="#{mainMenuControler.userName}"
						style="margin-right:10px" />
					<p:commandButton
						value="#{dictionaryControler.dictionary['Logoff']}"
						action="MainMenu?faces-redirect=true"
						actionListener="#{mainMenuControler.logoff}" update=":form03" />
				</div>
			</h:form>

		</p:layoutUnit>
		<!-- faces-redirect=true -->
		<p:layoutUnit position="west" size="270" header="Memu"
			resizable="true" closable="false" collapsible="true">
			<h:form id="form03">
				<p:menu style="width:95%;height:100%;borader:none">
					<p:submenu label="Roster System"
						rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('department') || mainMenuControler.hasUserRole('patient')}">
						<p:menuitem value="Department List" action="DepartmentList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('department')}" />
						<p:menuitem value="Patient List" action="PatientList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('patient')}" />
						<p:menuitem value="Doctor List" action="DoctorMeintenance"
							rendered="#{mainMenuControler.hasUserRole('admin')}" />
						<p:menuitem value="Medicine List" action="MedicineList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('medicine')}" />
						<p:menuitem value="Glossary" action="Glossary"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('glossary')}" />
						<p:menuitem value="News" action="NewsList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('news')}" />
						<p:menuitem value="Building" action="BuildingList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('building')}" />
						<p:menuitem value="Ward" action="WardList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('ward')}" />
						<p:menuitem value="Bed" action="BedList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('bed')}" />
						<p:menuitem value="Register Config" action="RegisterConfig"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('register_config')}" />
						<p:menuitem value="Treatment"
							action="Treatment"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('treatment')}" />
						<p:menuitem value="Charge"
							action="Charge"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('charge')}" />
						<p:menuitem value="GiveMedicine"
							action="GiveMedicine"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('give_medicine')}" />
						<p:menuitem value="fileUpload" action="fileUploadAuto"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('bed')}" />
					</p:submenu>
					<p:submenu label="Record System"
						rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('treatment_record')}">
						<p:menuitem value="Treatment Record" action="TreatmentRecordList"
							rendered="#{mainMenuControler.hasUserRole('admin') || mainMenuControler.hasUserRole('treatment_record')}" />
					</p:submenu>
				</p:menu>
			</h:form>
		</p:layoutUnit>

		<p:layoutUnit position="center">
			<ui:insert name="content">
			</ui:insert>
		</p:layoutUnit>

		<ui:insert name="dialog">
		</ui:insert>

		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="#{dictionaryControler.dictionary['Yes']}"
				type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="#{dictionaryControler.dictionary['No']}"
				type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>

		<p:ajaxStatus modal="true"
			style="width:64px;height:64px;position:fixed;right:5px;bottom:5px">
			<f:facet name="start">
				<p:graphicImage value="/images/loading1.gif" />
			</f:facet>

			<f:facet name="complete">
				<h:outputText value="" />
			</f:facet>
		</p:ajaxStatus>

	</p:layout>
</h:body>
</html>